GitHub Documents

This is an R Markdown format used for publishing markdown documents to GitHub. When you click the Knit button all R code chunks are run and a markdown file (.md) suitable for publishing to GitHub is generated.

Including Code

You can include R code in the document as follows:

pxweb_query_list <-
  list("Taloustoimi"=c("B1GMH"),
       "Tiedot"=c("kausitvv2015", "tasmvv2015"))

px_data1 <- 
  pxweb_get(url = "https://pxnet2.stat.fi:443/PXWeb/api/v1/fi/StatFin/kan/ntp/statfin_ntp_pxt_132h.px",
            query = pxweb_query_list)
## Warning: Missing mandatory variable(s): 'Vuosineljännes'. 
## All values are requested in query.
px_data1 <- as.data.frame(px_data1, column.name.type = "text", variable.value.type = "text")
colnames(px_data1) <- c("Vuosineljännes", "Taloustoimi", "Kausitasoitettu", "Alkuperäinen")
px_data1 <- px_data1 %>%
  mutate(Kausitasoitettu = Kausitasoitettu / 1000) %>%
  mutate(Alkuperäinen = Alkuperäinen / 1000)
px_data1$Vuosineljännes <- seq(as.Date("1990/1/1"), by = "quarter", length.out = nrow(px_data1))

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.